package com.shiku.staticstic.scheduler;

import java.text.SimpleDateFormat;
import java.util.Date;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;


@Component
public class UserDataStatisticScheduler {

	private static final Logger log = LoggerFactory.getLogger(UserDataStatisticScheduler.class);
	

	@Scheduled(cron="0 0 12 * * ?")
	public void execute(){
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
		log.debug("start time {}", sdf.format(new Date()));
		long begin = System.currentTimeMillis();
		// TODO
		long end = System.currentTimeMillis() - begin;
		log.debug("end time {}, run {}s", sdf.format(new Date()), end/1000);
	}
}
